// This file can be replaced during build by using the `fileReplacements` array.
// `ng build` replaces `environment.ts` with `environment.prod.ts`.
// The list of file replacements can be found in `angular.json`.

import { KeycloakService } from 'keycloak-angular';

export const environment = {
  production: false,
  useHash: true,
  api: {
    baseUrl: '/api'
  },
  // keycloak 初始化方法
  initializeKeycloak: function (keycloakSrc: KeycloakService) {
    return () =>
      keycloakSrc.init({
        config: {
          url: 'http://auth-server:9000/',
          realm: 'megrez',
          clientId: 'megrez-ng2'
        },
        initOptions: {
          onLoad: 'check-sso',
          silentCheckSsoRedirectUri: `${window.location.origin}/assets/silent-check-sso.html`
        },
        bearerExcludedUrls: ['/assets']
      });
  }
};
